/**
 * This file sets application-wide settings and 
 * launches the application when everything has
 * been loaded onto the page. 
 *
 */ 
Ext.regApplication({
    name                : "App",
    
    tabletStartupScreen : 'res/gfx/app/tablet_startup.png',
	phoneStartupScreen  : 'res/gfx/app/phone_startup.png',
    icon                : 'res/gfx/app/icon.png',
    
    glossOnIcon         : false,
    
    /**
     * This function is automatically called 
     * when the document has finished loading.
     * It opens/loads the main Viewport.
     *
     * @return {viewport}
     */
    launch: function() {
		if (Ext.get('loading-mask')) {
		    var loadmask = Ext.get('loading-mask');
		    Ext.Anim.run(loadmask, 'fade', {
		        easing: 'out',
		        duration: 500,
		        after: function() {
		            Ext.get('loading-mask').remove();
			        new App.View.Viewport();
			        // getSenchTouchVars();
		        }
		    }, this);
		}
    }
});
	
/**
 * Show Alert MSG with default Vars from 
 * Sencha Touch for testcases on mobile 
 * devices.
 *
 * @return {msg}
 */
var getSenchTouchVars = function(){
	Ext.Msg.alert('Detection:', [
		    "<b>Desktop:</b> "    + Ext.is.Desktop,
		"<br><b>Standalone:</b> " + Ext.is.Standalone,
		"<br><b>Tablet:</b> "     + Ext.is.Tablet,
		"<br><b>Phone:</b> "      + Ext.is.Phone,
		"<br><b>iOS:</b> "        + Ext.is.iOS,
		"<br><b>iPad:</b> "       + Ext.is.iPad,
		"<br><b>iPod:</b> "       + Ext.is.iPod,
		"<br><b>iPhone:</b> "     + Ext.is.iPhone
	].join(" "), Ext.emptyFn);
}
